package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.dto.EmpQueryDto;
import com.itheima.dto.EmpUpdateDto;
import com.itheima.pojo.Emp;
import com.itheima.vo.EmpVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface EmpMapper {

    @Select("select id, username, password, name, gender, phone, job, salary, image, entry_date, dept_id, create_time, update_time from emp order by update_time desc ")
    List<Emp> selectAll();

    @Select("select * from emp where id=#{id}")
    Emp selectid(Integer id);

    @Delete("delete from emp where id=#{id}")
    void deleteid(Integer id);

    void insert(Emp emp);

    void updata(Emp emp);

    List<EmpVo> query(EmpQueryDto dto);

    @Select("select * from emp where username=#{username}")
    Emp getbyusername(String username);

    @Delete("delete from emp where dept_id")
    void deletedeptid(Integer deptid);

  /*  @Update("update emp set password=#{newpassword}")
    void empupdate(EmpUpdateDto dto);*/

}